// Plop 入口文件

module.exports = (plop) => {
  // 基础的组件
  plop.setGenerator('BasicComponent', {
    description: 'create a basic react component',
    prompts: [
      {
        type: 'input',
        name: 'name',
        message: 'component name',
        default: 'NewComponent'
      }
    ],
    actions: [
      {
        type: 'addMany',
        destination: 'src/components/{{name}}',
        base: 'plop-templates/BasicComponent',
        templateFiles: 'plop-templates/BasicComponent/*.hbs'
      }
    ]
  })
  // 带有redux功能的组件
  plop.setGenerator('ConnectComponent', {
    description: 'create a react component with connect to redux',
    prompts: [
      {
        type: 'input',
        name: 'name',
        message: 'component name',
        default: 'NewComponent'
      }
    ],
    actions: [
      {
        type: 'addMany',
        destination: 'src/components/{{name}}',
        base: 'plop-templates/ConnectComponent',
        templateFiles: 'plop-templates/ConnectComponent/*.hbs'
      }
    ]
  })
}
